package cn.how2go.api.mapper;

import cn.how2go.api.common.WarningCount;
import cn.how2go.api.entity.Cone;
import cn.how2go.api.vo.ConeType;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LGP
 * @since 2020-05-31
 */
public interface ConeMapper extends BaseMapper<Cone> {
    @Update({"UPDATE cone SET Fence=#{Fence} where `Group` = #{Group}" })
    boolean updateByGroup(Cone cone);

    @Select("select `Group` as type,count(1) as alls from cone where state=0 group by `Group`")
    List<ConeType> countByType();
}
